package com.cloudlead.dictionaryAction.action;
import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.lang.persistence.ObjectList;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.dictionaryAction.BusinessModules;
import com.cloudlead.dictionaryAction.service.UserPermissionSer;
import com.cloudlead.dictionaryService.UserPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

/**
 * Created by Administrator on 2015/10/15.
 */
@Controller
public class UserPermissionActionFactory extends AbstractActionFactory implements UserPermissionService {
    public UserPermissionActionFactory() {
        super(BusinessModules.UserPermission);
    }
    @Autowired
    UserPermissionSer userPermissionSer;

    @Override
    @Action
    @Order(1)
    @Label("权限获取")
    public ObjectList getUserPermission(String user) {
        return new ObjectList(userPermissionSer.getUserPermission(user), "name,icon,url");
    }
}
